100
How do I enable the cross link support ( rectangular )

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement,oElement1
	LOCAL oElements
	LOCAL oLink,oLink1,oLink2
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",0,76)
			oElement := oElements:Add("Element <sha ;;0>C",-76,32)
				oElement:AutoSize := .F.
				oElement:Height := 32
			oElement1 := oElements:Add("Element <sha ;;0>D",76,32)
				oElement1:AutoSize := .F.
				oElement1:Height := 32
		oLinks := oSurface:Links()
			oLink := oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))
				oLink:StartPos := 1/*CenterAlignment*/
				oLink:EndPos := 1/*CenterAlignment*/
			oLink1 := oLinks:Add(oSurface:Elements:Item(2),oSurface:Elements:Item(1))
				oLink1:StartPos := 1/*CenterAlignment*/
				oLink1:EndPos := 1/*CenterAlignment*/
			oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(4))
			oLink2 := oLinks:Add(oSurface:Elements:Item(4),oSurface:Elements:Item(3))
				oLink2:StartPos := 0/*LeftAlignment*/
				oLink2:EndPos := 2/*RightAlignment*/
		oSurface:ShowLinks := 33/*exShowCrossLinksRect+exShowExtendedLinks*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
99
How do I show a link frmo bottom to top, or reverse, not from left to right

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLink
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",0,64)
		oLinks := oSurface:Links()
			oLink := oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))
				oLink:StartPos := 1/*CenterAlignment*/
				oLink:EndPos := 1/*CenterAlignment*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
98
What options to align the elements do I have if I use Arrange method

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface
	LOCAL h1,h2,h3

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:BeginUpdate()
		oSurface:ShowGridLines := .T.
		oElements := oSurface:Elements()
			h1 := oElements:Add("Top Alignment"):ID()
			oElements:Add("Element")
			oElements:Add("Element")
			oElements:Add("Element")
			h2 := oElements:Add("Center Alignment",,96):ID()
			oElements:Add("Element",,96)
			oElements:Add("Element",,96)
			oElements:Add("Element",,96)
			h3 := oElements:Add("Bottom Alignment",,178):ID()
			oElements:Add("Element",,192)
			oElements:Add("Element",,192)
			oElements:Add("Element",,192)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(3))
			oLinks:Add(oSurface:Elements:Item(2),oSurface:Elements:Item(4))
			oLinks:Add(oSurface:Elements:Item(2),oSurface:Elements:Item(3))
			oLinks:Add(oSurface:Elements:Item(5),oSurface:Elements:Item(6))
			oLinks:Add(oSurface:Elements:Item(5),oSurface:Elements:Item(7))
			oLinks:Add(oSurface:Elements:Item(6),oSurface:Elements:Item(8))
			oLinks:Add(oSurface:Elements:Item(6),oSurface:Elements:Item(7))
			oLinks:Add(oSurface:Elements:Item(9),oSurface:Elements:Item(10))
			oLinks:Add(oSurface:Elements:Item(9),oSurface:Elements:Item(11))
			oLinks:Add(oSurface:Elements:Item(10),oSurface:Elements:Item(12))
			oLinks:Add(oSurface:Elements:Item(10),oSurface:Elements:Item(11))
		oSurface:SetProperty("DefArrange",3/*exDefArrangeAlign*/,0)
		oSurface:Arrange(h1)
		oSurface:SetProperty("DefArrange",3/*exDefArrangeAlign*/,1)
		oSurface:Arrange(h2)
		oSurface:SetProperty("DefArrange",3/*exDefArrangeAlign*/,2)
		oSurface:Arrange(h3)
		oSurface:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
97
Is there an auto-arrange feature that will display the flow-chart centered and zoomed correctly after we are finished building it

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B"):ID := "B"
			oElements:Add("Element C"):ID := "C"
			oElements:Add("Element D"):ID := "D"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B"))
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("D"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("C"))
		oSurface:Arrange()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
96
Is it possible to change the distance between elements, when calling the Arrange method

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B"):ID := "B"
			oElements:Add("Element C"):ID := "C"
			oElements:Add("Element D"):ID := "D"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B"))
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("D"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("C"))
		oSurface:SetProperty("DefArrange",1/*exDefArrangeDX*/,0)
		oSurface:SetProperty("DefArrange",2/*exDefArrangeDY*/,0)
		oSurface:Arrange()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
95
How do I organize vertically the elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B"):ID := "B"
			oElements:Add("Element C"):ID := "C"
			oElements:Add("Element D"):ID := "D"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B"))
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("D"))
			oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("C"))
		oSurface:ShowLinksType := 2/*exLinkStraight*/
		oSurface:SetProperty("DefArrange",0/*exDefArrangeDir*/,1)
		oSurface:Arrange()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
94
Is there a way to create a link which has the same start and end element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element")
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(1))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
93
How can I prevent hiding the item when an item with an outgoing link, is collapsed

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Item <sha ;;0>1"):ID := 1
			oElements:Insert("Item <sha ;;0>2",1):ID := 2
			oElement := oElements:Add("Item <sha ;;0>3")
				oElement:ID := 3
				oElement:X := 96
				oElement:Y := 23
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(2),oSurface:Elements:Item(3))
		oSurface:ShowLinksOnCollapse := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
92
How can I change the toolbar's visual appearance

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:SetProperty("Background",148/*exToolBarAppearance*/,0x1000000)
		oSurface:SetProperty("Background",149/*exToolBarBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oSurface:SetProperty("Background",150/*exToolBarForeColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 40,40,40 } )  , .F. ))
		oSurface:SetProperty("Background",153/*exToolBarButtonDownBackColor*/,0x1606060)
		oSurface:SetProperty("Background",154/*exToolBarButtonDownForeColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oSurface:SetProperty("Background",155/*exToolBarButtonHotBackColor*/,0x1a0a0a0)
		oSurface:SetProperty("Background",156/*exToolBarButtonHotForeColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
91
How can I change the toolbar's background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",149/*exToolBarBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
90
How can I fit or ensure that all elements are in the control's client area
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element A",-500,-500):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oElements:Add("Element B",500,500):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oElements:Add("Element C",48,24)
		oSurface:FitToClient()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
89
When I use the context menu to insert an image, the size seems to be fixed to 32 pixels. How can I control / change this

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0,"multiline,wordwrap")*/
	/*Element.AutoSize = True*/
	DevOut( "Call Edit(0) method of the Element object" )
RETURN

PROCEDURE OnRClick(oSurface)
	/*SelElement(0).Edit(0,"multiline,wordwrap")*/
	oSurface:Selection := oSurface:ElementFromPoint(-1,-1)
	DevOut( "Call Edit(0) method of the SelElement(0) property" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/
		oSurface:RClick := {|| OnRClick(oSurface)} /*Occurs once the user right clicks the control.*/

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:VisualAppearance():Add(3,"c:\exontrol\images\hot.ebn")
		oSurface:SetProperty("Background",99/*exContextMenuAppearance*/,0x1000000)
		oSurface:SetProperty("Background",102/*exContextMenuSelBackColor*/,0x1fcddc0)
		oSurface:SetProperty("Background",88/*exElementBorderColor*/,0x3000000)
		oSurface:SetProperty("SelectObjectColor",AutomationTranslateColor( GraMakeRGBColor  ( { 192,221,252 } )  , .F. ))
		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oSurface:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif")
		oSurface:SetProperty("HTMLPicture","pic3","c:\exontrol\images\colorize.gif")
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElement := oElements:Add("Custom-size pictures:<br><img>pic1:24</img>,<img>pic2:48</img> ,... and so on.",96,48)
				oElement:ID := "B"
				oElement:CaptionSingleLine := 0/*exCaptionWordWrap*/
			oElements:Add("Element C",48,24)
		oSurface:EditContextMenuItems := "Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value = vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[group=3](<img>pic1:32</img>[id=57763],<img>pic2:32</img>[id=57763],Others[id=1000](default[group=3](<img>pic3</img>[id=57763]),<font ;6>other sizes[sep],<img>pic3:16</img>[id=57763],<img>pic3:32</img>[id=57763],<img>pic3:64</img>[id=57763]))"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
88
Can I add images to node while editing the node using the Edit method

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0,"multiline,wordwrap")*/
	/*Element.AutoSize = True*/
	DevOut( "Call Edit(0) method of the Element object" )
RETURN

PROCEDURE OnRClick(oSurface)
	/*SelElement(0).Edit(0,"multiline,wordwrap")*/
	oSurface:Selection := oSurface:ElementFromPoint(-1,-1)
	DevOut( "Call Edit(0) method of the SelElement(0) property" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/
		oSurface:RClick := {|| OnRClick(oSurface)} /*Occurs once the user right clicks the control.*/

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:SetProperty("Background",99/*exContextMenuAppearance*/,0x1000000)
		oSurface:SetProperty("Background",102/*exContextMenuSelBackColor*/,0x10000ff)
		oSurface:SelectObjectStyle := -1/*exNoLines*/
		oSurface:SetProperty("SelectObjectColor",AutomationTranslateColor( GraMakeRGBColor  ( { 192,221,252 } )  , .F. ))
		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oSurface:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif")
		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElement := oElements:Add("This is a node that displays pictures:<br><img>pic1:48</img>,<img>pic2:48</img> ,... and so on.",96,48)
				oElement:ID := "B"
				oElement:CaptionSingleLine := 0/*exCaptionWordWrap*/
			oElements:Add("Element C",48,24):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
87
I am using the Edit method to edit the node, but still not able to display multiple lines. Is this possible

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0,"multiline,wordwrap")*/
	/*Element.AutoSize = True*/
	DevOut( "Call Edit(0) method of the Element object" )
RETURN

PROCEDURE OnRClick(oSurface)
	/*SelElement(0).Edit(0,"multiline,wordwrap")*/
	oSurface:Selection := oSurface:ElementFromPoint(-1,-1)
	DevOut( "Call Edit(0) method of the SelElement(0) property" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/
		oSurface:RClick := {|| OnRClick(oSurface)} /*Occurs once the user right clicks the control.*/

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:SetProperty("Background",99/*exContextMenuAppearance*/,0x1000000)
		oSurface:SetProperty("Background",102/*exContextMenuSelBackColor*/,0x10000ff)
		oSurface:SelectObjectStyle := -1/*exNoLines*/
		oSurface:SetProperty("SelectObjectColor",AutomationTranslateColor( GraMakeRGBColor  ( { 192,221,252 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElement := oElements:Add("Right-<b>Click</b> the node to edit it.",96,48)
				oElement:ID := "B"
				oElement:CaptionSingleLine := 0/*exCaptionWordWrap*/
			oElements:Add("Element C",48,24):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
86
How can I change the visual appearance of the edit's context menu

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0)*/
	/*Element.AutoSize = True*/
	DevOut( "Call Edit(0) method of the Element object" )
RETURN

PROCEDURE OnRClick(oSurface)
	/*SelElement(0).Edit(0)*/
	oSurface:Selection := oSurface:ElementFromPoint(-1,-1)
	DevOut( "Call Edit(0) method of the SelElement(0) property" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/
		oSurface:RClick := {|| OnRClick(oSurface)} /*Occurs once the user right clicks the control.*/

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:SetProperty("Background",99/*exContextMenuAppearance*/,0x1000000)
		oSurface:SetProperty("Background",102/*exContextMenuSelBackColor*/,0x10000ff)
		oSurface:SelectObjectStyle := -1/*exNoLines*/
		oSurface:SetProperty("SelectObjectColor",AutomationTranslateColor( GraMakeRGBColor  ( { 192,221,252 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Right-Click to edit this node",96,48):ID := "B"
			oElements:Add("Element C",48,24):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
85
How can I edit the node once the user right-click the element

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0)*/
	/*Element.AutoSize = True*/
	DevOut( "Call Edit(0) method of the Element object" )
RETURN

PROCEDURE OnRClick(oSurface)
	/*SelElement(0).Edit(0)*/
	oSurface:Selection := oSurface:ElementFromPoint(-1,-1)
	DevOut( "Call Edit(0) method of the SelElement(0) property" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/
		oSurface:RClick := {|| OnRClick(oSurface)} /*Occurs once the user right clicks the control.*/

		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,48):ID := "B"
			oElements:Add("Element C",48,24):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
84
I wish to return the name that is displayed in the Element that I have selected

PROCEDURE OnSelectionChanged(oSurface)
	DevOut( "The number of selected elements is: " )
	DevOut( Transform(oSurface:SelCount(),"") )
	DevOut( oSurface:SelElement(0):Caption() )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SelectionChanged := {|| OnSelectionChanged(oSurface)} /*Notifies your application that the control's selection has been changed.*/

		oSurface:HideSel := .F.
		oSurface:SetProperty("SelectObjectColorInactive",oSurface:SelectObjectColor())
		oSurface:SetProperty("SelectObjectTextColorInactive",oSurface:SelectObjectTextColor())
		oElements := oSurface:Elements()
			oElements:Add("Element 1"):Selected := .T.
			oElement := oElements:Add("Element 2")
				oElement:X := 32
				oElement:Y := 32

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
83
Been playing with the surface control with the embedded ExGrid ActiveX...I can see most events coming through via the Surface control but I can't get the OnOLEStartDrag event to fire

PROCEDURE OnOleEvent(oSurface,Element,Ev)
	/*Ev.Param(1).Value = 2*/
	/*Ev.Param(0).Value.SetData("items to be carried")*/
	DevOut( Transform(Ev,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface
	LOCAL oObject

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:OleEvent := {|Element,Ev| OnOleEvent(oSurface,Element,Ev)} /*Occurs once an inside control fires an event.*/

		oSurface:BeginUpdate()
		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Exontrol.Grid")
				oElement:ElementFormat := "" + CHR(34) + "client" + CHR(34) + ""
				oObject := oElement:Object()
		oSurface:MoveCorner(17/*exMiddleCenter*/,0/*exTopLeft*/)
		oSurface:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
82
Is it possible to assign/add a percent to an element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:Add("Element A")
				oElement:ID := "A"
				oElement:CaptionAlign := 1/*exTopCenter*/
				oElement:AutoSize := .F.
				oElement:Height := 36
				oElement:Width := 96
				oElement:MinHeight := 36
				oElement:BackgroundExt := "none[(2,100%-15,100%-4,14)](left[50%,back=RGB(0,255,0),text=`15%`,align=0x11,pattern=6,frame])"
				oElement:SetProperty("BackgroundExtValue",2/*exIndexExt2*/,2/*exClientExt*/,"75%")
				oElement:SetProperty("BackgroundExtValue",2/*exIndexExt2*/,4/*exTextExt*/,oElement:BackgroundExtValue(2/*exIndexExt2*/,2/*exClientExt*/))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
81
How can I disable selecting the nodes/elements
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowSelectObject := 0/*exDisallow*/
		oSurface:AllowSelectNothing := .F.
		oSurface:AllowSelectObjectRect := 0/*exDisallow*/
		oSurface:AllowToggleSelectKey := 0/*exDisallow*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
80
How can I set my zooming levels on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ZoomLevels := "75,100,150,200"
		oSurface:AllowLinkObjects := 0/*exDisallow*/
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
79
How can I prevent zooming the surface

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowZoomSurface := 0/*exDisallow*/
		oSurface:AllowZoomWheelSurface := .F.
		oSurface:ToolBarFormat := "-1,100"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
78
How can I prevent adding the links
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowLinkObjects := 0/*exDisallow*/
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
77
How can I fix all elements on the surface, so no moving or resizing is allowed

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowResizeObject := 0/*exDisallow*/
		oSurface:AllowMoveObject := 0/*exDisallow*/
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
76
How can I link elements with no pressing the SHIFT key
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowInsertObject := .F.
		oSurface:AllowLinkObjects := 1/*exLeftClick*/
		oSurface:AllowMoveObject := 0/*exDisallow*/
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
75
How can I disable creating the tree/hierarchies
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowInsertObject := .F.
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
74
How can I create new elements using simple clicks rather than double clicks

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowCreateObject := 1/*exLeftClick*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
73
How can I disable creating new elements at runtime
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowCreateObject := 0/*exDisallow*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
72
I've noticed that the links cut the elements. Is it possible to show the links on the back

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ShowLinksType := 2/*exLinkStraight*/
		oSurface:ShowLinks := 1/*exShowExtendedLinks*/
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",48,12):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")):Caption := "link"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
71
How can I show a picture on the link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")):Caption := "<img>pic1:24</img>"
		oSurface:ShowLinksType := 2/*exLinkStraight*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
70
How can I show a caption on the link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")):Caption := "link"
		oSurface:ShowLinksType := 2/*exLinkStraight*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
69
I am using EBN to show my arrows, the question is if I can make it bigger/larger

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oAppearance
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oAppearance := oSurface:VisualAppearance()
			oAppearance:Add(1,"c:\exontrol\images\normal.ebn")
			oAppearance:Add(2,"CP:1 -2 -2 2 2")
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",96,-24):ID := "C"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B"))
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C"))
		oSurface:SetProperty("LinksArrowColor",0x2000000)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
68
Is it possible to show different type of arrows for links

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oElements := oSurface:Elements()
			oElements:Add("Element A"):ID := "A"
			oElements:Add("Element B",96,24):ID := "B"
			oElements:Add("Element C",96,-24):ID := "C"
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")):SetProperty("ArrowColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C")):SetProperty("ArrowColor",0x1000000)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
67
How can I remove or clear the entire surface
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:Elements():Add("element")
		oSurface:Elements():Clear()
		oSurface:Home()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
66
How can I programmatically add a child element, or create a tree/hierarchy

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Root"):ID := "rootID"
			oElements:Insert("Child 1","rootID")
			oElements:Insert("Child 2","rootID"):ID := "childID"
			oElements:Insert("Child 3","rootID")
			oElements:Insert("Sub-Child 1.2","childID")
			oElements:Insert("Sub-Child 2.2","childID")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
65
I've noticed that the element's background is transparent. Can I make it opaque

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("new 1"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
			oElements:Add("new 1",24,24):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
64
How can I add a resizable element
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement,oElement1
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:Add("new 1")
				oElement:AutoSize := .F.
				oElement:Resizable := .T.
			oElement1 := oElements:Add("new 1",24,24)
				oElement1:AutoSize := .F.
				oElement1:Resizable := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
63
How can I programmatically add a new element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("new 1")
			oElements:Add("new 1",24,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
62
Is it possible to assign a tooltip to an element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:Elements():Add("Element with a Tooltip"):ToolTip := "This is a bit of text that should be displayed when cursor hovers the element."

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
61
How do I specify direct/straight link for all links

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ShowLinksType := 3/*exLinkStraight+exLinkDirect*/
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
60
How do I show a direct/straight link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)):ShowLinkType := 3/*exLinkStraight+exLinkDirect*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
59
How can I ensure that a specified element fits the surface's visible area

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oPattern
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oPattern := oElements:Add("Element A",-100):Pattern()
				oPattern:Type := 6/*exPatternBDiagonal*/
				oPattern:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
			oElements:Add("Element B",2000):ScrollTo(17/*exMiddleCenter*/)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
58
Is it possible to show a pattern like ( not available ) over an element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oPattern
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oPattern := oElements:Add("Element+Pattern",-100):Pattern()
				oPattern:Type := 6/*exPatternBDiagonal*/
				oPattern:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
			oElements:Add("Element",100)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
57
How can I specify a different overview color for the element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element+A",-100):SetProperty("OverviewColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oElements:Add("Element+B",100)
		oSurface:SetProperty("ScrollPos",.T.,512)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
56
I've noticed that some lines are shown on the border, how can I get ride of them

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element+A",-100)
			oElements:Add("Element+B",100)
		oSurface:SetProperty("ScrollPos",.T.,512)
		oSurface:SetProperty("OverviewColor",-1)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
55
How can I handle clicking an icon or a picture

PROCEDURE OnHandCursorClick(oSurface,Element,Hit,Key)
	DevOut( Transform(Key,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:HandCursorClick := {|Element,Hit,Key| OnHandCursorClick(oSurface,Element,Hit,Key)} /*The uses clicks a part of the element that shows the had cursor.*/

		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oSurface:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif")
		oElement := oSurface:Elements():Add("Caption")
			oElement:Pictures := "1,2/pic1/pic2"
			oElement:PicturesAlign := 33/*exBottomCenter*/
			oElement:ShowHandCursorOn := 771/*exShowHandCursorExtraPictures+exShowHandCursorPictures+exShowHandCursorIcon+exShowHandCursorPicture*/
			oElement:CaptionAlign := 1/*exTopCenter*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
54
How can I display a picture

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oSurface:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif")
		oSurface:Elements():Add("Element"):Pictures := "pic1/pic2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
53
How can I display a picture

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif")
		oSurface:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif")
		oSurface:Elements():Add("Icon <img>pic1</img> or <img>pic2</img>")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
52
How can I display an icon

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oSurface:Elements():Add("Element"):Pictures := "0/1,2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
51
How can I display an icon

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oSurface:Elements():Add("Icon <img>1</img> or <img>2</img>")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
50
How can I prevent moving all descendent/outgoing elements when focused element is moved, more like a free move
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))
		oSurface:ShowLinksType := 3/*exLinkStraight+exLinkDirect*/
		oSurface:AllowMoveDescendents := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
49
How can I display the +/- expand/collapse glyphs next to linked elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))
		oSurface:Elements:Item(1):Expanded := .F.
		oSurface:ExpandLinkedElements := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
48
How can I host the Exontrol.Button inside the surface

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:Add("ActiveX")
				oElement:Type := 2/*exElementHostControl*/
				oElement:ElementFormat := "" + CHR(34) + "check" + CHR(34) + ":18," + CHR(34) + "client" + CHR(34) + ""
				oElement:ShowCheckBox := .T.
				oElement:Control := "Exontrol.Button"
				oElement:Object():Caption := "<sha ;;0>button"
				oElement:Height := 32
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
47
How can I host a Command button

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "" + CHR(34) + "check" + CHR(34) + ":18," + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:ShowCheckBox := .T.
				oElement:Height := 48
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
46
How can I handle the events of the inner ActiveX control

PROCEDURE OnOleEvent(oSurface,Element,Ev)
	DevOut( Transform(Ev,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:OleEvent := {|Element,Ev| OnOleEvent(oSurface,Element,Ev)} /*Occurs once an inside control fires an event.*/

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "" + CHR(34) + "check" + CHR(34) + ":18," + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:ShowCheckBox := .T.
				oElement:Height := 48
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
45
How can I display a checkbox while my node hosts an ActiveX inside

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "" + CHR(34) + "check" + CHR(34) + ":18," + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:ShowCheckBox := .T.
				oElement:Height := 48
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
44
Is it possible to display a caption while the element hosts an ActiveX control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "18;" + CHR(34) + "caption" + CHR(34) + "/" + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:Caption := "Forms.CommandButton"
				oElement:CaptionAlign := 1/*exTopCenter*/
				oElement:Height := 48
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
43
I host an ActiveX control but it does not cover the whole element. What can be done

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement,oElement1
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "" + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:Height := 32
				oElement:Width := 128
			oElement1 := oElements:InsertControl("Forms.CommandButton.1")
				oElement1:ElementFormat := "" + CHR(34) + "client" + CHR(34) + ""
				oElement1:Object():Caption := "command"
				oElement1:Height := 32
				oElement1:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
42
How can I host my ActiveX to the surface (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:InsertControl("Forms.CommandButton.1")
				oElement:ElementFormat := "" + CHR(34) + "client" + CHR(34) + ""
				oElement:Object():Caption := "command"
				oElement:Height := 32
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
41
How can I host my ActiveX to the surface (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:Add("ActiveX")
				oElement:Type := 2/*exElementHostControl*/
				oElement:ElementFormat := "" + CHR(34) + "client" + CHR(34) + ""
				oElement:Control := "Forms.CommandButton.1"
				oElement:Object():Caption := "command"
				oElement:Height := 32
				oElement:Width := 128

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
40
How can I define the elements with a solid color on the background

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",88/*exElementBorderColor*/,-1)
		oSurface:SetProperty("Background",89/*exElementStatusColor*/,-1)
		oSurface:SetProperty("Background",90/*exElementBackColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Node A")
			oElements:Add("Node B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
39
Can I display the status to a different part of the element

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:Elements():Add("Node"):StatusAlign := 3/*exAlignBottom*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
38
How can I remove or hide the status part of the event

PROCEDURE OnAddElement(oSurface,Element)
	/*Element.StatusSize = 0*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/

		oSurface:SetProperty("Background",89/*exElementStatusColor*/,-1)
		oElements := oSurface:Elements()
			oElements:Add("Node A")
			oElements:Add("Node B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
37
How can I change the visual appearance of the border for all elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:SetProperty("Background",88/*exElementBorderColor*/,0x1000000)
		oElements := oSurface:Elements()
			oElements:Add("Element+A")
			oElements:Add("Element+B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
36
How can I change the color of the border for all elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",88/*exElementBorderColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element+A")
			oElements:Add("Element+B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
35
How can I remove the border for all elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",88/*exElementBorderColor*/,-1)
		oElements := oSurface:Elements()
			oElements:Add("Element+A")
			oElements:Add("Element+B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
34
How do I change the visual appearance the glpyh that shows when the element is added as a child

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:VisualAppearance():Add(2,"c:\exontrol\images\pushed.ebn")
		oSurface:SetProperty("Background",86/*exHoverInsertObject*/,0x1000000)
		oSurface:SetProperty("Background",87/*exHoverInsertObjectGlyph*/,0x2000000)
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
33
Is it possible to change the color for the glpyh that shows when the element is added as a child

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",86/*exHoverInsertObject*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
		oSurface:SetProperty("Background",87/*exHoverInsertObjectGlyph*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
32
How can I change the color to show a valid link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",83/*exLinkObjectsValidColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
31
How can I change the color to show an invalid link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",82/*exLinkObjectsInvalidColor*/,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
30
How can I disable adding the elements as child of other nodes
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowInsertObject := .F.
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
29
How can I prevent moving the outgoing /descendents elements when moving an element
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ShowLinksType := 3/*exLinkStraight+exLinkDirect*/
		oSurface:AllowMoveDescendents := .F.
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
28
How can I add programatically a link

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oLinks
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)
		oLinks := oSurface:Links()
			oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
27
How do I prevent adding a link between elements
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowLinkObjects := 0/*exDisallow*/
		oElements := oSurface:Elements()
			oElements:Add("Element <sha ;;0>A")
			oElements:Add("Element <sha ;;0>B",96,24)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
26
How can I hide the 100% button ( zoom ) on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarFormat := "-1,100"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
25
Is it possible to hide the Home button on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarFormat := "-1,101"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
24
How can I hide the grid lines, including the axis

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ShowGridLines := .F.
		oSurface:AxisStyle := -1/*exNoLines*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
23
How can I hide the grid lines

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ShowGridLines := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
22
How can I clear the images shown on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarReplaceIcon(0,-1)
		oSurface:ToolBarRefresh()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
21
How can I replace the default icons shown on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarReplaceIcon(0,-1)
		oSurface:ToolBarImages("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
20
How can I replace the default icons shown on the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarImages("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oSurface:SetProperty("ToolBarCaption",100,"<img>3</img> aka1")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
19
How can I add an anchor element to the control's toolbar

PROCEDURE OnToolBarAnchorClick(oSurface,AnchorID,Options)
	DevOut( Transform(AnchorID,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarAnchorClick := {|AnchorID,Options| OnToolBarAnchorClick(oSurface,AnchorID,Options)} /*Occurs when an anchor element is clicked, on the control's toolbar.*/

		oSurface:ToolBarFormat := "-1,100,101,|,102"
		oSurface:SetProperty("ToolBarCaption",102,"<a a1>anchor</a>")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
18
How can I add a button/image to the control's toolbar

PROCEDURE OnToolBarClick(oSurface,ID,SelectedID)
	DevOut( Transform(ID,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarClick := {|ID,SelectedID| OnToolBarClick(oSurface,ID,SelectedID)} /*Occurs when the user clicks a button in the toolbar.*/

		oSurface:ToolBarImages("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oSurface:ToolBarFormat := "-1,100,101,102"
		oSurface:SetProperty("ToolBarCaption",102,"<img>3</img> new")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
17
How can I add a button to the control's toolbar

PROCEDURE OnToolBarClick(oSurface,ID,SelectedID)
	DevOut( Transform(ID,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarClick := {|ID,SelectedID| OnToolBarClick(oSurface,ID,SelectedID)} /*Occurs when the user clicks a button in the toolbar.*/

		oSurface:ToolBarFormat := "-1,100,101,102"
		oSurface:SetProperty("ToolBarCaption",102,"<sha ;;0>new")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
16
How can I hide the control's toolbar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:ToolBarVisible := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
15
How can I prevent selecting the elements
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AllowSelectObject := 0/*exDisallow*/
		oSurface:AllowSelectObjectRect := 0/*exDisallow*/
		oSurface:AllowToggleSelectKey := 0/*exDisallow*/
		oSurface:Elements():Add("element")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
14
How can I show the selected elements the same as the control has the focus

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:HideSel := .F.
		oSurface:SetProperty("SelectObjectColorInactive",oSurface:SelectObjectColor())
		oSurface:SetProperty("SelectObjectTextColorInactive",oSurface:SelectObjectTextColor())
		oSurface:Elements():Add("element"):Selected := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
13
How can I show the selected elements with a different border

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
		oSurface:HideSel := .F.
		oSurface:SelectObjectStyle := 48/*exLinesSolid*/
		oSurface:SetProperty("SelectObjectColor",0x1000000)
		oSurface:SetProperty("SelectObjectTextColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oSurface:SetProperty("SelectObjectColorInactive",oSurface:SelectObjectColor())
		oSurface:SetProperty("SelectObjectTextColorInactive",oSurface:SelectObjectTextColor())
		oSurface:Elements():Add("element"):Selected := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
12
How can I show the selected elements with a different background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:HideSel := .F.
		oSurface:SelectObjectStyle := -1/*exNoLines*/
		oSurface:SetProperty("SelectObjectColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
		oSurface:SetProperty("SelectObjectTextColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oSurface:SetProperty("SelectObjectColorInactive",oSurface:SelectObjectColor())
		oSurface:SetProperty("SelectObjectTextColorInactive",oSurface:SelectObjectTextColor())
		oSurface:Elements():Add("element"):Selected := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
11
Is it possible to add an inner control on the surface

PROCEDURE OnOleEvent(oSurface,Element,Ev)
	DevOut( Transform(Ev,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:OleEvent := {|Element,Ev| OnOleEvent(oSurface,Element,Ev)} /*Occurs once an inside control fires an event.*/

		oElements := oSurface:Elements()
			oElement := oElements:Add("activex hosting")
				oElement:Type := 2/*exElementHostControl*/
				oElement:Control := "Forms.CommandButton.1"
				oElement:Caption := "Command Button"
				oElement:Height := 64
				oElement:Width := 128
				oElement:ElementFormat := "14;" + CHR(34) + "caption" + CHR(34) + "/" + CHR(34) + "client" + CHR(34) + ""
				oElement:CaptionAlign := 1/*exTopCenter*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
10
How can I make the control read-only
PROCEDURE OnLayoutStartChanging(oSurface,Operation)
	DevOut( Transform(Operation,"") )
	oSurface:CancelLayoutChanging()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/

		oElements := oSurface:Elements()
			oElements:Add("new element")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
9
How can I handle clicking a picture on the element

PROCEDURE OnHandCursorClick(oSurface,Element,Hit,Key)
	DevOut( Transform(Key,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:HandCursorClick := {|Element,Hit,Key| OnHandCursorClick(oSurface,Element,Hit,Key)} /*The uses clicks a part of the element that shows the had cursor.*/

		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oElements := oSurface:Elements()
			oElement := oElements:Add("new element")
				oElement:CaptionAlign := 2/*exTopRight*/
				oElement:PicturesAlign := 0/*exTopLeft*/
				oElement:ShowHandCursorOn := 3335/*exShowHandCursorAnchorAll+exShowHandCursorPictures+exShowHandCursorIcon+exShowHandCursorPicture*/
				oElement:Pictures := "0,1,2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
8
How can I show the hand cursor when user hovers the element's image

PROCEDURE OnHandCursorClick(oSurface,Element,Hit,Key)
	DevOut( Transform(Key,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:HandCursorClick := {|Element,Hit,Key| OnHandCursorClick(oSurface,Element,Hit,Key)} /*The uses clicks a part of the element that shows the had cursor.*/

		oSurface:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oElements := oSurface:Elements()
			oElement := oElements:Add("new element")
				oElement:CaptionAlign := 2/*exTopRight*/
				oElement:PicturesAlign := 0/*exTopLeft*/
				oElement:ShowHandCursorOn := 3335/*exShowHandCursorAnchorAll+exShowHandCursorPictures+exShowHandCursorIcon+exShowHandCursorPicture*/
				oElement:Pictures := "0,1,2"

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
7
How can I show the hand cursor when user hovers the element's checkbox

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oElement := oElements:Add("new element")
				oElement:CaptionAlign := 2/*exTopRight*/
				oElement:CheckBoxAlign := 0/*exTopLeft*/
				oElement:ShowCheckBox := .T.
				oElement:ShowHandCursorOn := 3084/*exShowHandCursorAnchorAll+exShowHandCursorCheck*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
6
How can I remove the status part for all elements

PROCEDURE OnAddElement(oSurface,Element)
	/*Element.StatusSize = 0*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/

		oSurface:SetProperty("Background",89/*exElementStatusColor*/,-1)
		oSurface:Elements():Add("new element")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
5
How can I remove the border for all elements

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("Background",88/*exElementBorderColor*/,-1)
		oSurface:Elements():Add("new element")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
4
How do I edit the element's caption once the user creates the element

PROCEDURE OnCreateElement(oSurface,Element)
	/*Element.Edit(0)*/
	/*Element.AutoSize = True*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:CreateElement := {|Element| OnCreateElement(oSurface,Element)} /*The user creates at runtime a new element.*/


	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
3
How can I align the element's checkbox next to the text

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElement
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:BeginUpdate()
		oElements := oSurface:Elements()
			oElement := oElements:Add("text")
				oElement:ShowCheckBox := .T.
				oElement:CaptionAlign := 2/*exTopRight*/
				oElement:CheckBoxAlign := 0/*exTopLeft*/
		oSurface:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
2
How can I assign a check-box to all elements

PROCEDURE OnAddElement(oSurface,Element)
	/*Element.ShowCheckBox = True*/

RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/

		oSurface:BeginUpdate()
		oElements := oSurface:Elements()
			oElements:Add("",-24,-24)
			oElements:Add(""):Checked := 1/*exChecked*/
		oSurface:Home()
		oSurface:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1
How do I change the control's background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oSurface

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oSurface:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN